package br.foton.la.agenda.connection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionFactory {
	private static final String NM_BANCO = "agenda";
	private static final String PORTA = "5432";
	private static final String USER = "postgres";
	private static final String PASS = "postgres";
	
	public Connection getConnection(){
		try {
			return DriverManager.getConnection("jdbc:postgresql://localhost:" + PORTA + "/"
					+ NM_BANCO + "?user=" + USER + "&password=" + PASS + "");
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
}
